package acme.db;

import acme.entity.Brand;
import acme.entity.Department;
import acme.entity.Product;

public class DaoFactory {
	
	private static CrudDao<Brand> brandDao = null;
	private static CrudDao<Department> deptDao = null;
	private static CrudDao<Product> productDao = null;
	
	public static CrudDao<Product> getProductDAO(){
		if(productDao == null){
			productDao = new DAOMap.ProductDAOMap<Product>();
		}
		return productDao;
	}
	
	public static CrudDao<Brand> getBrandDAO(){
		if(brandDao == null){
			brandDao = new DAOMap.BrandDAOMap<Brand>();
		}
		return brandDao;
	}
	
	public static CrudDao<Department> getDepartmentDAO(){
		if(deptDao == null){
			deptDao = new DAOMap.DepartmentDAOMap<Department>();
		}
		return deptDao;
	}

}
